Replace deprecated inet_ntoa() with inet_ntop()#13763
Open
geokoko wants to merge 3 commits intoopen-mpi:mainfrom
Open
Replace deprecated inet_ntoa() with inet_ntop()#13763geokoko wants to merge 3 commits intoopen-mpi:mainfrom
geokoko wants to merge 3 commits intoopen-mpi:mainfrom
Conversation
inet_ntoa() is deprecated according to Linux man pages and is also on Fedora's rpminspect forbidden functions list. Replacing all occurences with inet_ntop(), which writes to a caller-provided buffer. Signed-off-by: geokoko <71934918+geokoko@users.noreply.github.com>
Signed-off-by: geokoko <71934918+geokoko@users.noreply.github.com>
bosilca
previously approved these changes
Mar 18, 2026
| } | ||
| } | ||
| #else | ||
| sprintf(src, "%s", inet_ntoa(inaddr.sin_addr)); |
Member
There was a problem hiding this comment.
Please change the size of the src and dst char arrays to be INET_ADDRSTRLEN instead of 64.
| # else | ||
| used += snprintf(&outmsg[used], DEBUG_LENGTH - used, "%s -", inet_ntoa(inaddr.sin_addr)); | ||
| { | ||
| char ep_addr[INET_ADDRSTRLEN]; |
Member
There was a problem hiding this comment.
I'm not a fan of this double copy, but it's outside the critical path.
…2_endpoint.c Signed-off-by: geokoko <71934918+geokoko@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
inet_ntoa()is deprecated according to Linux man pages and is on Fedora's rpminspect forbidden functions list (badfuncs). All occurrences are replaced withinet_ntop(), which writes to a caller-provided buffer instead of returning a pointer to an internal static buffer.Also removed two inet_ntoa valgrind leak suppressions in
contrib/openmpi-valgrind.suppthat are no longer needed.Files changed:
Fixes #13759